package com.tgy.myplus;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.Arrays;
import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
public class Demo {
    private String name;

    Demo(String name){
        this.name = name;
    }


    public static void print(String content){
        System.out.println("content");
    }

    interface InterfaceExample{
        Demo create(String name);
    }

    public static void main(String[] args) {
        InterfaceExample com =  Demo::new;

        //传入一个String 放回一个Demo对象
        InterfaceExample com1 =  (a)->{
            return new Demo(a);
        };
        Demo bean = com.create("hello world");
        System.out.println(bean.name);

        Demo bean1 = com.create("你好世界");
        System.out.println(bean1.name);
    }
}

